from roman_range import RomanRange

class RomansConverter():

    def __init__(self):
        #TODO: linked list
        self.ranges = RomanRange(1, 'I', 'V')
        self.ranges.next = RomanRange(10, 'X', 'L')
        self.ranges.next.next = RomanRange(100, 'C', 'D')
        self.ranges.next.next.next = RomanRange(1000, 'M', None)

    def to_roman(self, decimal_number):
        result  = ''
        for range in self.ranges.enumerate():
            to_prepend = range.to_roman(decimal_number)
            if (to_prepend == None):
                break
            result = to_prepend + result

        return result
